package com.zhuandaonet.manager.controller;

import com.zhuandaonet.manager.req.RoleReq;
import com.zhuandaonet.manager.resp.RoleResp;
import com.zhuandaonet.manager.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/manager/role")
public class RoleController {

    @Autowired
    private RoleService roleService;

    @PostMapping
    public RoleResp add(@RequestBody RoleReq req){
        return roleService.add(req);
    }


    @PutMapping
    public RoleResp update(@RequestBody RoleReq req){
        return roleService.update(req);
    }


    @GetMapping
    public RoleResp get(@PathVariable String id){
        return roleService.get(id);
    }
}
